init()
function init() {
  getData(detail => {
    console.log(detail)
  })
}

// 获取数据
function getData(callback) {
  let dataObj = [
    { id: 1, name: '张三' },
    { id: 2, name: '李四' }
  ]
  dataObj.length > 0 && callback(dataObj)
}